
<?php include_once("header.html")?>
<script src="<?php echo $www_site_url?>/public/js/PCASClass.js"></script>

<div id="wrap">  <br />
  <div class="tabsA">
    	<div class="left">

        	<div class="right"><?php echo lang("registration");?></div>
        </div>
      <div class="des"><?php echo lang("already_signup");?> <a href="<?php echo $www_site_url?>/index.php/passport/login"><?php echo lang("login");?>!</a></div>
  </div>
  <div class="<?php echo lang("regstepclass");?> regStep2 clear"></div>
  <div class="regInfo">

<FORM name="registerform" id="registerform" method="POST" onsubmit="return checkOnSubmit('registerform', rules);" >
<input type="hidden" name="action" value="passport">
<input type="hidden" name="op" value="saveuserext">


<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD width="40%" class="text"></TD>
<TD width="60%"><div id="msg" style="margin:0 auto;"></div></TD>
</TR
><TR>
<TR>
<TD width="40%" class="text"></TD>
<TD width="60%" class="text" style="text-align:left;">一．<?php echo lang('contact')?>(*<?php echo lang('required')?>)</TD>
</TR
><TR>
<TD width="40%" class="text">*<?php echo lang('real_name')?>:</TD>
<TD width="60%"><div id="errorsDiv_realname"></div><INPUT class="input" type="text" name="realname" value="" id="realname" /></TD>
</TR>

<TR><TD class="text">*<?php echo lang('mobile')?>:</TD>
<TD><div id="errorsDiv_mobile"></div><INPUT class="input" type="text" name="mobile" id="mobile" /></TD>
</TR>

<TR>
<TD class="text"><?php echo lang('workphone')?>:</TD>
<TD><div id="errorsDiv_workphone"></div><INPUT class="input" type="text" name="workphone" id="workphone"/></TD>
</TR>
<TR>
<TD class="text"><?php echo lang('homephone')?>:</TD>
<TD><div id="errorsDiv_homephone"></div><INPUT class="input" type="text" name="homephone" id="homephone" /></TD>
</TR>
<TR>
<TD class="text">QQ:</TD>
<TD><div id="errorsDiv_qq"></div><INPUT class="input" type="text" name="qq" id="qq" value="" /></TD>
</TR>
<TR>
<TD class="text">MSN:</TD>
<TD><div id="errorsDiv_msn"></div><INPUT class="input" type="text" name="msn" id="msn" value="" /></TD>
</TR>
<TR>
<TD class="text">*<?php echo lang('living_city')?>:</TD>
<TD><div id="errorsDiv_city"></div>
<select name="province" id="province"></select><select name="city" id="city"></select>

</TD>
</TR>
<TR>
<TD class="text">*<?php echo lang('district')?>:</TD>
<TD><div id="errorsDiv_area"></div>
<select name="area"></select></TD>
</TR>
<script>
new PCAS("province","city","area");

</script>

<TR>
<TD class="text"><?php echo lang('postaddress');?>:</TD>
<TD><div id="errorsDiv_msn"></div><INPUT class="input" type="text" name="postaddress" id="postaddress" value="" /></TD>
</TR>


<TR>
<TD class="text"></TD>
<TD class="text"  style="text-align:left;">二.    <?php echo lang('profiles')?></TD>
</TR>

<TR>
<TD class="text">*<?php echo lang('birthday')?>:</TD>
<TD>

<div id="errorsDiv_birthdateyear"></div><select name="birthdateyear" id="birthdateyear">
			<option value="">--</option>
			<?php for ($i=1921;$i<2000;$i++){?>
			<option value="<?php echo $i;?>"><?php echo $i;?></option>
			<?php }?>

		</select><?php echo lang('year')?><select name="birthdatemonth" id="birthdatemonth">
		<option value="">--</option>
		<?php for ($i=1;$i<=12;$i++){?>
			<option value="<?php echo $i;?>" ><?php echo $i;?></option>
			<?php }?>


		</select><?php echo lang('month')?><select name="birthdateday" id="birthdateday">
<option value="">--</option>
				<?php for ($i=1;$i<=31;$i++){?>
			<option value="<?php echo $i;?>"><?php echo $i;?></option>
			<?php }?>

		</select><?php echo lang('day')?></TD>
</TR>
<TR>
<TD class="text">*<?php echo lang('marriage')?>:</TD>
<TD><div id="errorsDiv_maritalstatus"></div>
<select name="maritalstatus" id="maritalstatus">
<option value=""><?php echo lang('selected')?></option>
			<option value="M"><?php echo lang('married')?></option>
			<option value="S"><?php echo lang('single')?></option>
			<option value="D"><?php echo lang('divorced')?></option>
			</select>
 </TD>
</TR>
<TR>
<TD class="text"><?php echo lang("quan_of_children");?>:</TD>
<TD><div id="errorsDiv_children"></div>
<select name="children" id="children">
<?php for ($i=0;$i<=5;$i++){?>
			<option value="<?php echo $i;?>" ><?php echo $i;?></option>
			<?php }?>
</select>
 </TD>
</TR>
<TR>
<TD class="text">*<?php echo lang("nationality");?>:</TD>
<TD><div id="errorsDiv_nationality"></div><INPUT class="input" type="text" name="nationality" id="nationality" /></TD>
</TR>
<TR>
<TD class="text"><?php echo lang("birthplace");?>:</TD>
<TD><div id="errorsDiv_birthplace"></div><INPUT class="input" type="text" name="birthplace" id="birthplace" /></TD>
</TR>
<TR>
<TD class="text">*<?php echo lang("job_position");?>:</TD>
<TD><div id="errorsDiv_occupation"></div><INPUT class="input" type="text" name="occupation" id="occupation"/></TD>
</TR>
<TR>
<TD class="text"><?php echo lang("company_name");?></TD>
<TD><div id="errorsDiv_companyname"></div><INPUT class="input" type="text" name="companyname" id="companyname" /></TD>
</TR>
<TR>
<TD class="text">*<?php echo lang("salary");?>:</TD>
<TD><div id="errorsDiv_householdincome"></div>
<select name="householdincome" id="householdincome" >
					<option value="" ><?php echo lang('selected')?></option>
					<option value="1">&lt;3,000</option>
					<option value="2">3,000-6,000</option>
					<option value="3">6,000-9,000</option>
					<option value="4">9,000-12,000</option>
					<option value="5">12,000-15000</option>
					<option value="6">15,000-30,000</option>
					<option value="7">30,000</option>
</select>
 </TD>
</TR>
<TR>
<TD class="text">*<?php echo lang("education");?>:</TD>
<TD><div id="errorsDiv_education"></div><select name="education" id="education">
<option value=""><?php echo lang('selected')?></option>
					<option value="1"><?php echo lang("middle_school");?></option>
					<option value="2"><?php echo lang("technical_secondary");?></option>
					<option value="3"><?php echo lang("junior_college");?> </option>
					<option value="4"><?php echo lang("master_degree");?></option>
					<option value="5"><?php echo lang("doctor_degree");?></option>

				</select></TD>
</TR>
<TR>
<TD class="text">*<?php echo lang("have_own_car");?></TD>
<TD><div id="errorsDiv_havecar"></div><select name="havecar" id="havecar">
<option value=""><?php echo lang('selected')?></option>
					<option value="1" >Yes</option>
					<option value="2" >No</option>

				</select></TD>
</TR>
<TR>
<TD class="text"><?php echo lang("other_language");?></TD>
<TD><div id="errorsDiv_otherlanguage"></div>
<INPUT class="input" type="text" name="otherlanguage" id="otherlanguage" />
</TD>
</TR>
<TR>
<TD class="text"><?php echo lang("have_been_mystery_shopper")?></TD>
<TD><div id="errorsDiv_been_mysteryshopper"></div><select name="been_mysteryshopper" id="been_mysteryshopper">
<option value="0"><?php echo lang('selected')?></option>
					<option value="1">Yes</option>
					<option value="2">No</option>

				</select></TD>
</TR>

<TR>
<TD class="text"><?php echo lang("how_do_you_know_spot");?> </TD>
<TD><div id="errorsDiv_hearabout"></div>
<select name="hearabout" id="hearabout">
<option value="0"><?php echo lang('selected')?></option>
			<option value="1"><?php echo lang('introduced_by_friends')?></option>
			<option value="2"><?php echo lang('internet_advertisement')?></option>
			<option value="3"><?php echo lang('outdoor_advertising')?>  </option>
			<option value="4"><?php echo lang('newspaper')?></option>
			<option value="5"><?php echo lang('television')?></option>

			</select></TD>
</TR>
<TR>
<TD class="text"><?php echo lang("receive_newsletter");?> </TD>
<TD><div id="errorsDiv_newletters"></div><select name="newletters" id="newletters">
<option value="0"><?php echo lang('selected')?></option>
			<option value="1">Yes</option>
			<option value="2">No</option>
			</select></TD>
</TR>


<TR><TD class="text">&nbsp;</TD><TD>
  <input name="button" type="submit" class="btn" id="button" value="<?php echo lang('signup')?>" />

</TD>
</TR>
</TABLE>
</form>

<SCRIPT>
//only for test purposes
function checkOnSubmit(formName, r) {
   // document.getElementById(yav_config.errorsdiv).className = '';
   // document.getElementById(yav_config.errorsdiv).style.display = 'none';
   // var alertType = document.getElementById('alertType').value;
    if (yav.performCheck(formName, r, 'inline')) {

    	var url = "<?php echo $www_site_url?>/index.php";
		var params = mini.form.serialize($(formName));
		mini.ajax.post(url, function(r){

			var r = eval('(' + r + ')');
			if(r.s==200){
				window.location.href = r.d;
			}
			if(r.s==400){
				//$('msg').innerHTML = r.m;
				alert(r.m);
			}
		}, params);

    	return false;

    }
    return false;
}

var rules=new Array();
rules[0]='realname|required|<?php echo lang('realnamerule')?>';
rules[1]='mobile|required|<?php echo lang('required');?>';
rules[2]='mobile|regexp|^[8,1]\\d{10}$|<?php echo lang('mobilerule');?>';
rules[3]='area|required|<?php echo lang('required');?>';
rules[4]='area|required|<?php echo lang('required');?>';
rules[5]='birthdateyear|required|<?php echo lang('required');?>';
rules[6]='maritalstatus|required|<?php echo lang('required');?>';
rules[7]='nationality|required|<?php echo lang('required');?>';
rules[8]='occupation|required|<?php echo lang('required');?>';
rules[9]='householdincome|required|<?php echo lang('required');?>';
rules[10]='education|required|<?php echo lang('required');?>';
rules[11]='havecar|required|<?php echo lang('required');?>';
rules[12]='hearabout|required|<?php echo lang('required');?>';
rules[13]='city|required|<?php echo lang('required');?>';


yav.addHelp('realname', '<?php echo lang('realnamerule')?>');
yav.addHelp('mobile', '');
yav.addHelp('city', '');
yav.addHelp('area', '');
yav.addHelp('birthdateyear', '');
yav.addHelp('maritalstatus', '');
yav.addHelp('nationality', '');
yav.addHelp('occupation', '');
yav.addHelp('householdincome', '');
yav.addHelp('education', '');
yav.addHelp('havecar', '');
yav.addHelp('hearabout', '');
yav.addHelp('city', '');

var captchaOK = 2;  // 2 - not yet checked, 1 - correct, 0 - failed
var account = '';
// a simple ajax implementation

function ajaxCall(s) {
	account = s;
	mini.ajax.get("<?php echo $www_site_url?>/index.php/passport/checkuser/user/" + escape(document.getElementById(s).value), function(r){
	    captchaOK = r;
	    if(captchaOK != 1) {
	      	yav.displayMsg(account, '<?php echo lang('userexist')?>', yav_config.innererror);
	      	document.registerform.registerbtn.disabled=true;
	      	return false;
	      } else {
	          yav.displayMsg(account, '<?php echo lang('userisok')?>', yav_config.innerhelp);
	          document.registerform.registerbtn.disabled=false;
	          return true;
	      }
	});
    return false;
}

window.onload = function(){
	yav.init('registerform', rules);
}
</SCRIPT>
<p>&nbsp;</p>
  </div>
</div>
</div>
<?php include_once("footer.html")?>
